package com.yu.crm.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yu.crm.domain.pojo.CrmBuilding;
import com.yu.crm.domain.response.BuildingRep;
import com.yxzz.common.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 后台楼栋管理表 Mapper 接口
 * </p>
 *
 * @author ct
 * @since 2019-08-15
 */
public interface CrmBuildingMapper extends BaseMapper<CrmBuilding> {

    /**
     * 通过区域名称查询楼栋名称
     * @param areaName
     * @param tabId
     * @return
     */
    List<String> listByBuildingName(@Param("areaName") String areaName, @Param("tabId") Integer tabId);

    /**
     * 通过区域名称和楼栋名称查询楼层名称
     * @param areaName 区域名称
     * @param buildingName 楼栋名称
     * @param tabId
     * @return
     */
    List<String> listByBuildingFloorName(@Param("areaName") String areaName, @Param("buildingName") String buildingName, @Param("tabId") Integer tabId);

    /**
     * 查询当前用户所在所有 区域名称
     * @param tabId 企业id
     * @return
     */
    List<String> listByBuildingAreaName(@Param("tabId") Integer tabId);

    IPage<CrmBuilding> getPage(Page<CrmBuilding> page, @Param(Constants.WRAPPER) QueryWrapper<CrmBuilding> queryWrapper);

    List<BuildingRep> listBuilding(@Param("tabId") Integer tabId);

    BuildingRep listAreaManageById(@Param("id") Long id);

    List<BuildingRep> listBuildingByAreaManageId(@Param("areaManageId")Long areaManageId);
}
